MCI Command Strings and Messages

MCI supports command strings and command messages. You can use either strings or messages, or both, in your MCI application.

    The command-message interface consists of constants and structures. You use the mciSendCommand_H60X4 function to send a message to an MCI device.

    The command-string interface provides a textual version of the command messages. You use the mciSendString1PGC_K2 function to send a string to an MCI device. Command strings duplicate the functionality of the command messages. The Microsoft Windows operating system converts the command strings to command messages before sending them to the MCI driver for processing.

 

The command messages that retrieve information do so in the form of structures, which are easy to interpret in a C application. These structures can contain information on many different aspects of a device. The command strings that retrieve information do so in the form of strings, and can only retrieve one string at a time. Your application must parse or test each string to interpret it. You might find that the command messages are easier to use than the command strings in some cases, but the command strings are easy to remember and implement. Some MCI applications use command strings when the return value will not be used (other than to verify success) and command messages when retrieving information from the device.

When commands are discussed, this overview uses the string form of the command followed by the message form in parentheses.